package net.sf.rose.jdbc.service;

import net.sf.rose.jdbc.factory.ConnectFactory;
import net.sf.rose.jdbc.factory.DataSourceConnectFactory;

/**
 * 功能:数据库连接工厂类
 * @author fengjian
 * @since 2013/05/18
 */
public class DataBaseFactory {

	/** JDBC配置文件名 */
	private static String JDBC_CONFIG_FILE = "resource/jdbc.properties";

	private static DataSourceConnectFactory factory = null;

	static {
		factory = new DataSourceConnectFactory();
		factory.setJDBCFile(JDBC_CONFIG_FILE);
	}

	public static ConnectFactory getFactory() {
		return factory;
	}

	public static Service getService() {
		Service s = new Service();
		s.setConnectFactory(factory);
		return s;
	}
}
